<?php

/**
 * 系统登录
 */

namespace app\member\api;

use \app\base\api\BaseApi;

class LoginApi extends BaseApi {

    /**
     * 用户登录
     */
    public function index() {
        $data = target('Member/Member', 'service')->loginUser($this->data['username'], $this->data['password']);
        if(!$data) {
            $this->error(target('Member/Member', 'service')->getError());
        }
        $this->success('帐号登录成功!', $data);
    }

}